package mobi.yuanshen.mapper;

import mobi.yuanshen.domain.entity.Admin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 23207
* @description 针对表【admin(管理员用户表)】的数据库操作Mapper
* @createDate 2025-10-15 13:55:46
* @Entity mobi.yuanshen.domain.entity.Admin
*/
public interface AdminMapper extends BaseMapper<Admin> {

    /**
     * 获取用户权限列表
     * @param userId
     * @return
     */
    @Select("select distinct  permission_code from admin_role_permission where admin_id = #{userId}")
    List<String> getPermissionList(Long userId);

    /**
     * 获取用户角色列表
     * @param userId
     * @return
     */
    @Select("select distinct  role_code from admin_role_permission where admin_id = #{userId}")
    List<String> getRoleList(Long userId);
}




